package org.example.seckill.controller;

import org.example.seckill.rabbitmq.MQSender;
import org.example.seckill.vo.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author woopsion
 * @date 2025-07-05
 */
@Controller
public class rabbitMqController {
    @Autowired
    private MQSender mqSender;
    
    @RequestMapping("/mq")
    @ResponseBody
    public RespBean sendMq(){
        mqSender.send("hellp rabbitMq !~");
        return RespBean.success();
    }    
    
    @RequestMapping("/mq_fanout")
    @ResponseBody
    public RespBean send_fanout(){
        mqSender.send_fanout("hellp rabbitMq !~");
        return RespBean.success();
    }    
    
    @RequestMapping("/mq_direction_pay")
    @ResponseBody
    public RespBean send_pay(){
        mqSender.send_direct_pay("hellp rabbitMq !~");
        return RespBean.success();
    }   
    
    @RequestMapping("/mq_direction_order")
    @ResponseBody
    public RespBean send_order(){
        mqSender.send_direct_order("hellp rabbitMq !~");
        return RespBean.success();
    }
    
}
